Append file ext to returned query
Append file ext to returned query
am 17.01.2008 13:30:09 von Mikii
Hi - I have this working
while($row=mysql_fetch_array($result))
{
$filename=$row['cat_title'];
echo "
\n";
}
I need to append ".html" (the extension) onto $filename so it returns
pagename.html
How to append this in PHP please?, and thanks for your time.
Re: Append file ext to returned query
am 17.01.2008 13:40:06 von rf
"Mikii" wrote in message
news:lTHjj.82140$wD5.40455@newsfe3-gui.ntli.net...
> Hi - I have this working
>
> while($row=mysql_fetch_array($result))
> {
> $filename=$row['cat_title'];
> echo "\n";
> }
>
>
> I need to append ".html" (the extension) onto $filename so it returns
>
> pagename.html
$filename . ".html" ?
--
Richard.
Re: Append file ext to returned query
am 17.01.2008 13:53:22 von Mikii
"rf" wrote in message
news:G0Ijj.4481$421.3063@news-server.bigpond.net.au...
>
> "Mikii" wrote in message
> news:lTHjj.82140$wD5.40455@newsfe3-gui.ntli.net...
>> Hi - I have this working
>>
>> while($row=mysql_fetch_array($result))
>> {
>> $filename=$row['cat_title'];
>> echo "\n";
>> }
>>
>>
>> I need to append ".html" (the extension) onto $filename so it returns
>>
>> pagename.html
>
> $filename . ".html" ?
>
> --
> Richard.
Thanks Richard for reading:
echo "\n"
gives parse error unexpected T_CONSTANT_ENCAPSED. Is this an escaping issue?
Re: Append file ext to returned query
am 17.01.2008 14:08:37 von kimandre
Mikii wrote:
> Hi - I have this working
>
> while($row=mysql_fetch_array($result))
> {
> $filename=$row['cat_title'];
> echo "
\n";
> }
>
>
> I need to append ".html" (the extension) onto $filename so it returns
>
> pagename.html
>
>
> How to append this in PHP please?, and thanks for your time.
Just add it to the text string (inside the unescaped "'s):
echo "\n";
--
Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Re: Append file ext to returned query
am 17.01.2008 14:20:34 von Toby A Inkster
Mikii wrote:
> echo "
".
> $filename."\n"
>
> gives parse error unexpected T_CONSTANT_ENCAPSED. Is this an escaping
> issue?
echo "\n"
Or, more readably:
printf(''."\n",
$filename,
$filename);
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 18 days, 32 min.]
Gnocchi all'Amatriciana al Forno
http://tobyinkster.co.uk/blog/2008/01/15/gnocchi-allamatrici ana/
Re: Append file ext to returned query
am 17.01.2008 14:30:33 von Jeff Gaines
On 17/01/2008 in message <6dIjj.49118$Hc3.20300@newsfe1-gui.ntli.net>
Mikii wrote:
>Thanks Richard for reading:
>echo "
\n"
>
>gives parse error unexpected T_CONSTANT_ENCAPSED. Is this an escaping
>issue?
I would say you need another full stop / period in there after . ".html"
echo "\n"
or you could run it together:
echo "\n"
--
Jeff Gaines Damerham Hampshire UK
That's an amazing invention but who would ever want to use one of them?
(President Hayes speaking to Alexander Graham Bell on the invention of the
telephone)
Re: Append file ext to returned query
am 17.01.2008 15:05:42 von Jerry Stuckle
Jeff Gaines wrote:
> On 17/01/2008 in message <6dIjj.49118$Hc3.20300@newsfe1-gui.ntli.net>
> Mikii wrote:
>
>> Thanks Richard for reading:
>> echo "
".
>> $filename."\n"
>>
>> gives parse error unexpected T_CONSTANT_ENCAPSED. Is this an escaping
>> issue?
>
> I would say you need another full stop / period in there after . ".html"
>
> echo "".
> $filename."\n"
>
> or you could run it together:
>
> echo "\n"
>
>
Or you could make it easier on yourself:
echo "\n"
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: Append file ext to returned query
am 17.01.2008 15:59:32 von Mikii
"Jerry Stuckle" wrote in message
news:XYudnauSfKxv_RLanZ2dnUVZ_v3inZ2d@comcast.com...
> Jeff Gaines wrote:
>> On 17/01/2008 in message <6dIjj.49118$Hc3.20300@newsfe1-gui.ntli.net>
>> Mikii wrote:
>>
>>> Thanks Richard for reading:
>>> echo "".
>>> $filename."\n"
>>>
>>> gives parse error unexpected T_CONSTANT_ENCAPSED. Is this an escaping
>>> issue?
>>
>> I would say you need another full stop / period in there after . ".html"
>>
>> echo "".
>> $filename."\n"
>>
>> or you could run it together:
>>
>> echo "\n"
>>
>>
>
> Or you could make it easier on yourself:
>
> echo "\n"
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstucklex@attglobal.net
> ==================
I like easy :)
Thank you all.